let str = "QYYQ67";

let buffer = Buffer.from(str);

console.log(buffer.toString('base64'));

let uint8Array = new Uint8Array(16);
uint8Array.set([
    149,
    241,
    2,
    33,
    41,
    216,
    34,
    233,
    171,
    249,
    77,
    132,
    184,
    52,
    57,
    237
]);
console.log(Buffer.from(uint8Array).toString('base64'));